package org.example.infrastructure.persistence.orm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.domain.model.entity.url.UrlShortenerGroup;
import org.example.domain.model.entity.url.req.UrlShortenerGroupSortReq;

import java.util.List;

@Mapper
public interface UrlGroupMapper extends BaseMapper<UrlShortenerGroup> {

    Integer selectCountByUserName(@Param(value = "userName") String userName);

    List<UrlShortenerGroup> listGroupByUserName(@Param(value = "userName") String userName);

    void updateGroup(@Param(value = "gid") String gid,
                     @Param(value = "userName") String userName,
                     @Param(value = "groupName") String groupName);

    void deleteGroup(@Param(value = "gid") String gid,
                     @Param(value = "userName") String userName);

    void sortGroup(@Param(value = "reqList") List<UrlShortenerGroupSortReq> reqList,
                   @Param(value = "userName") String userName);

    List<String> selectGitListByUserName(@Param(value = "userName")String userName);
}
